/**
* Copyright (c) 2016-2100 yunclouds
*/
package com.yunqian.redot.domain;

import com.yunqian.model.BaseModel;
import com.yunqian.redot.constant.Tables;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import javax.persistence.*;

/**
 * 
 *
 * @author zsy
 * 2018-09-29 15:18:12
 */
@Data
@Entity
@Table(name = Tables.USERS)
@EqualsAndHashCode(callSuper = false)
public class Users extends BaseModel<Long>{
    
    /**用户名*/
    @Column(name = "name")
    private String name;
    /**用户名*/
    @Column(name = "real_name")
    private String realName;
    /**密码*/
    @Column(name = "password")
    private String password;
    /**角色*/
    @Column(name = "role_id")
    private Long roleId;
    /**电子邮箱*/
    @Column(name = "email")
    private String email;
    /**手机*/
    @Column(name = "phone")
    private String phone;
    /**状态 1 -启用 2-禁用*/
    @Column(name = "status")
    private Integer status = 1;

    @ManyToOne
    @JoinColumn(name = "role_id", referencedColumnName = "id", insertable = false, updatable = false)
    @Fetch(FetchMode.SELECT)
    private Role role;

    public Users() {
    }

}
